package Vue;

import java.awt.Color;
import java.awt.Graphics;
import java.util.Observable;
import java.util.Observer;
import javax.swing.JPanel;

public class MonPanel extends JPanel implements Observer{

	public MonPanel() {
		super();
	}
	
	public void paintComponent(Graphics g) {

			int r = (int) (Math.random() * 250);
			int gr = (int) (Math.random() * 250);
			int b = (int) (Math.random() * 250);

			g.setColor(new Color(r,gr,b));

			int ht = (int) ((Math.random() * 120) + 10);
			int width = (int) ((Math.random() * 120) + 10);

			int x = (int) ((Math.random() * 500) + 10);
			int y = (int) ((Math.random() * 500) + 10);

			g.fillRect(x,y,ht, width);
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		repaint();		
	}
}
